﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceProcess;
using System.Configuration.Install;
using System.ComponentModel;

namespace SMTP
{
    [RunInstaller(true)]
    class SMTPInstaller : Installer
    {
        
        public SMTPInstaller()
        {
            var oProcessInstaller = new ServiceProcessInstaller();
            var oServiceInstaller = new ServiceInstaller();

            //set the privileges
            oProcessInstaller.Account = ServiceAccount.LocalSystem;

            oServiceInstaller.DisplayName = "Enen SMTP";
            oServiceInstaller.StartType = ServiceStartMode.Manual;

            //must be the same as what was set in Program's constructor
            oServiceInstaller.ServiceName = "Enen SMTP";

            this.Installers.Add(oProcessInstaller);
            this.Installers.Add(oServiceInstaller);
        }
    }
}
